What is the result of "new int[ 0 ]"? [closed]
Posted
by ArunSaha
on Stack Overflow
See other posts from Stack Overflow
or by ArunSaha
Published on 2010-04-28T17:38:34Z
Indexed on
2010/04/28
17:47 UTC
Read the original article
Hit count: 187
c++
Possible Duplicates:
What does zero-sized array allocation do/mean?
C++ new int[0] — will it allocate memory?
int * p;
p = new int[ 0 ];
What is the expected outcome when new is called for zero number of elements? Is the outcome defined or undefined?
Further, is it okay to call
delete [] p;
on that pointer?
What is the intuition/analogy to this situation of pointer to an array of zero elements?
Thanks in advance. Regards, Arun
© Stack Overflow or respective owner